---
title: dub.analytics.clicks.topLinks
sidebarTitle: Top Links
description: Retrieve the top links by number of clicks for a domain or the authenticated workspace.
---

import AnalyticsArguments from "/snippets/analytics-arguments.mdx";

<Note>
  Analytics endpoints require a [Pro plan](https://d.to/pro) subscription or
  higher.
</Note>

<AnalyticsArguments />

## Response

<ResponseField name="link" type="string" required>
  The unique ID of the short link
</ResponseField>

<ResponseField name="clicks" type="number" required>
  The number of clicks from this link
</ResponseField>

<RequestExample>

```typescript
await dub.analytics.clicks.topLinks({
  key: "dummy",
  domain: "dub.sh",
  interval: "30d",
});
```

</RequestExample>

<ResponseExample>

```typescript
[
  { link: "cluvb4cwi0001sd593yfdl1sz", clicks: 19 },
  { link: "clri4mgix0001l608ru12tcfr", clicks: 8 },
];
```

</ResponseExample>
